﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using ZeroSum.DependencyInjection.Attributes;
using ZeroSum.DependencyInjection.Interfaces;

namespace ZeroSumDBM.Application;

/// <summary>
///     Identity层初始化注册，要早于AspNetCore
///     晚于Domain, Infrastructure, Application
/// </summary>
[StartupOrder(1001)]
public class Startup : IAppStartup
{
    public void ConfigurationServices(IServiceCollection services, IConfiguration configuration)
    {
        // 注册授权相关服务的实现
        services.TryAddScoped(typeof(IAuthApplicationService), typeof(AuthApplicationService));
        services.TryAddScoped(typeof(IMenuApplicationService), typeof(MenuApplicationService));
        services.TryAddScoped(typeof(IRoleApplicationService), typeof(RoleApplicationService));
        services.TryAddScoped(typeof(IUserApplicationService), typeof(UserApplicationService));

    }
}